#include <bits/stdc++.h>
using namespace std;
long long n, l, ans;
long long d[64], e[64];
int main()
{
    freopen("lock.in", "r", stdin);
    freopen("lock.out", "w", stdout);
    scanf("%lld%lld", &n, &l);
    l = (l + 1) << 30;
    for (long long i = 0, a, b; i < n; i++)
    {
        scanf("%lld%lld", &a, &b);
        a = (a << 30) + b;
        for (long long j = 59; j >= 0; j--)
        {
            if (a >> j & 1)
            {
                if (!d[j])
                {
                    d[j] = a;
                }
                a ^= d[j];
            }
        }
    }
    for (long long i = 0; i < 60; i++)
    {
        for (long long j = i - 1; j >= 0; j--)
        {
            if (d[i] >> j & 1)
            {
                d[i] ^= d[j];
            }
        }
    }
    for (long long i = 59, x = 0; i >= 0; i--)
    {
        if ((x ^ d[i]) < l && d[i])
        {
            memset(e, 0, sizeof(e));
            for (long long j = 0; j < i; j++)
            {
                for (long long k = 29, y = d[j] & ((1 << 30) - 1); k >= 0; k--)
                {
                    if (y >> k & 1)
                    {
                        if (!e[k])
                        {
                            e[k] = y;
                        }
                        y ^= e[k];
                    }
                }
            }
            for (long long j = 29, y = x & ((1 << 30) - 1); j >= 0; j--)
            {
                y = max(y, y ^ e[j]);
                ans = max(ans, y);
            }
            x ^= d[i];
            ans = max(ans, x & ((1 << 30) - 1));
        }
    }
    printf("%lld\n", ans);
    return 0;
}